// ==UserScript==
// @name         alist to maccms
// @namespace    @skapp66
// @version      0.1
// @description  alist to maccms
// @author       @skapp66
// @match        http://alist.aaa.bbb/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=aaa.bbb
// @grant        GM_addStyle
// @grant        GM_getResourceText
// @require      https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js
// ==/UserScript==

(function () {
    'use strict';
    // 添加按钮
    function addParseBtn() {
        var ht = $('<div class="parse_btn" style="cursor:pointer;color: #ffffff;padding: 6px;border-radius: 3px;background: green;">开始校验</div>')
        $('.hope-breadcrumb__list').append(ht)
        $('.parse_btn').click(function () {
            var alist = $('.obj-box a')
            var arr = []
            for (var i = 0; i < alist.length; i++) {
                arr.push(i + 1 + '$' + $(alist[i]).attr('href'))
            }
            var str = arr.join('\n');
            var textarea = $('<textarea class="parse_text" style="width: 1000px;height:500px"></textarea>').val(str)
            $('.parse_text').remove()
            $('.hope-breadcrumb__list').append(textarea)
        })
    }
    $(document).ready(function () {
        setTimeout(function () {
            addParseBtn();
        }, 2000)

    })

    // Your code here...
})();